package com.ssmbook2020.web;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ssmbook2020.bean.BookBean;
import com.ssmbook2020.service.BookService;

@Controller
public class BookController {

	@Autowired
	private BookService bookService =null;

	public void setBookService(BookService bookService) {
		this.bookService = bookService;
	}
	
	@RequestMapping("/listBook.htm")
	public String listBook(HttpServletRequest request){
		
		List<BookBean> list=bookService.getAllBook();
		request.setAttribute("bookList", list);
		return "listBook.jsp";
	}
	
}
